<%@ page language="java" contentType="text/html; charset=UTF-8"  pageEncoding="UTF-8"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<%--2017-03-09 18:03--%>

<style>
    .homepage{
        width: 100%;
        padding-right: 380px;
        position: relative;
        transition: all .4s;
    }
    #rightTreeBox{
        position: absolute;
        right:0;
        top: 0;
        width: 325px;
        transition: all .4s;
    }
    .advList{
        padding: 0;
    }
    .advList li{
        background: url(${ctx}/static/images/disc.png) no-repeat center left;
        margin-bottom: 15px;
        background-size: auto 43%;
    }

    .advList a{
        color: #fff;
    }
    .leftInfoList{
        padding: 0;
    }
    .leftInfoList a{
        color: #fff;
    }
    .page-item-main{
        display: flex;
        width: 100%;
        flex-direction: row;
        flex-wrap: warp;
        justify-content: space-between;
    }
    .page-item{
        box-sizing: border-box;
        height: 142px;
        float: left;
        border-radius: 0;
        background: #ddd;
        margin-right: 10px;
        margin-bottom: 15px;
        position: relative;
        transition:.3s;
    }
    .page-item:last-child{
        margin-right: 0;
    }
    .page-item.sm{
        /*flex-grow: 1.88;*/
        width:39%;
    }
    .page-item.xs{
        /*flex-grow: 0.75;*/
        width:19%;
    }
    .page-item:hover{
        opacity: 0.8;
        border:7px solid #ffffff;
        border-radius: 3px;
    }
    .page-item i{
        display: block;
        width: 100%;
        text-align: center;
        font-size: 42px;
        padding-top: 45px;
        text-shadow: none;
    }
    .page-item>a{
        display: block;
        width:100%;
        height:100%;
        color: #fff;
        text-decoration: none;
    }
    .page-item span{
        display: block;
        position: absolute;
        width: 100%;
        bottom: 26px;
        text-align: center;
        font-size: 21px;
        text-shadow: none;
    }
    .right-tree{
        background: #dee5ff;
    }
    .right-tree a span{
        text-shadow: none !important;
    }
    .right-tree .tree-head{
        width: 100%;
        height: 220px;
        border-bottom: 1px solid #7a7676;
        margin-bottom: 10px;
        padding-top: 20px;
        text-align: center;
    }
    .right-tree .tree-head .tree-header{
        width: 160px;
        height: 160px;
        border-radius: 100%;
        background: #9de0eb;
        margin: 0 auto;
        overflow: hidden;
        margin-bottom: 8px;
    }
    .right-tree .tree-head .tree-header img{
        width: 100%;
        height: 100%;
        border: none;
        border-radius: 100%;
    }
    .right-tree .tree-head span{
        text-align: center;
        font-size: 18px;
        color: #7a7676;
        text-shadow: none;
    }
    a.more{
        color: #fff;
        position: relative;
        top: 5px;
    }
    .event-box{
        width: 100%;
        height: 80px;
        border-bottom: 1px dashed rgb(2,30,103);
        margin-bottom: 15px;
    }
    .event-box-l{
        width: 100px;
        height:60px;
        border-right: 1px solid #fff;
        float: left;
        text-align: center;
    }
    .event-box-l i{
        color: #fff;
        font-size: 46px;
        line-height: 60px;
    }
    .event-box a.eventitle{
        color: #fff;
        display: inline-block;
        margin-left: 15px;
        margin-bottom: 15px;
        font-size: 18px;
        text-decoration: none;
    }
    .event-box a.eventitle:hover{
        color: #20a0ff;
    }
    .event-box a.eventgs{
        color: #fff;
        display: inline-block;
        margin-left: 15px;
        font-size: 16px;
    }
    .event-box:last-child{
        border-bottom: none;
        margin-bottom:0;
    }
    .right-tree-btn{
        position: absolute;
        width:51px;
        height:46px;
        border-radius: 2px 0 0 2px;
        background: url(${ctx}/static/images/mainIcon/showHide.png) no-repeat top center;
        left: -51px;
        cursor: pointer;
        top:0;
        line-height: 30px;
        text-align: center;
    }
    /*.right-tree-btn i{*/
        /*font-size: 20px;*/
    /*}*/
    /*.right-tree-btn:hover{*/
        /*color: #20a0ff;*/
    /*}*/
    .right-tree-btn2{
        display: none;
        position: absolute;
        width:51px;
        height:46px;
        border-radius: 2px 0 0 2px;
        background: url(${ctx}/static/images/mainIcon/showHide.png) no-repeat bottom center;
        right: 0;
        top:141px;
        line-height: 30px;
        text-align: center;
        cursor: pointer;
        z-index: 2;
    }
    .right-tree-btn2 i{
        font-size: 20px;
    }
    .right-tree-btn2:hover{
        color: #20a0ff;
    }
    .head-high{
        background: #4d81ba;
    }
    .panel-heading{
        font-size:23px;
        font-weight: normal;
    }
</style>

<ul class="breadcrumb panel">
    <li><a href="#">沈阳情报合成研判平台</a></li>
    <li class="active"><i class="fa fa-home"></i> 首页</li>
</ul>
<div class="right-tree-btn2">
    <%--<i class="fa fa-angle-left"></i>--%>
</div>
<div class="homepage">
    <div class="row">
        <div class="col-xs-4" style="padding-right: 110px;">
            <div class="panel">
                <div class="panel-heading">
                    <i class="fa fa-volume-down" style="font-size: 32px;vertical-align: middle;"></i>
                    公告
                    <a href="javascript:ggMore('AN_GG');" class="pull-right more">
                        更多
                    </a>
                </div>
                <div class="panel-body" style="height: 330px;">
                    <ul class="advList" id="advList">
                    </ul>
                </div>
            </div>
            <div class="panel">
                <div class="panel-heading">
                    <i class="fa fa-info-circle" style="font-size: 30px;"></i> 我的事件
                </div>
                <div class="panel-body" style="height: 287px;">
                    <div class="event-box">
                        <div class="event-box-l">
                            <i class="icon iconfont icon-icontobesignedon"></i>
                        </div>
                        <a href="javascript:loadFun('/taskUnassign/toTaskUnassignIndex');" class="eventitle">待签收事件</a><br>
                        <a href="javascript:loadFun('/taskUnassign/toTaskUnassignIndex');" class="eventgs dqs">3件</a>
                    </div>
                    <div class="event-box">
                        <div class="event-box-l">
                            <i class="icon iconfont icon-pending"></i>
                        </div>
                        <a href="javascript:loadFun('/taskWait/toTaskWaitIndex');" class="eventitle">待审批事件</a><br>
                        <a href="javascript:loadFun('/taskWait/toTaskWaitIndex');" class="eventgs dsp">3件</a>
                    </div>
                    <div class="event-box">
                        <div class="event-box-l">
                            <i class="icon iconfont icon-handle"></i>
                        </div>
                        <a href="javascript:loadFun('/judgetask/toJudgeTaskIndex');" class="eventitle">待办理事件</a><br>
                        <a href="javascript:loadFun('/judgetask/toJudgeTaskIndex');" class="eventgs dbl">3件</a>
                    </div>
                </div>
            </div>
        </div>

        <div class="col-xs-8">
            <div class="page-item-main">
                <div class="page-item sm" style="background: #01b0f1">
                    <a href="javascript:loadFun('/judgmenthall/toJudgmentHallInfo');">
                        <i class="icon iconfont icon-yanpandating" style="font-size: 70px;"></i>
                        <span>研判大厅</span>
                    </a>
                </div>
                <div class="page-item xs" style="background: #33daa6">
                    <a href="http://10.1.2.100:8082/dataserver/nc.html" target="_blank">
                        <i class="icon iconfont icon-woshou" style="font-size: 60px;"></i>
                        <span>情报协作</span>
                    </a>
                </div>
                <div class="page-item xs" style="background: #b25cb7">
                    <a href="javascript:;">
                        <i class="fa fa-envelope-o" style="font-size: 47px;padding-top: 30px;"></i>
                        <span>信息报送</span>
                    </a>
                </div>
                <div class="page-item xs" style="background: #e46c0b">
                    <a href="http://10.78.4.129/jsec-cas-qbfwz/login/" target="_blank">
                        <i class="icon iconfont icon-qingbaofuwuzhan" style="font-size: 60px;"></i>
                        <span>情报服务站</span>
                    </a>
                </div>
            </div>
            <div class="page-item-main">
                <div class="page-item xs" style="background: #01af50">
                    <a href="http://10.78.5.9/seeyon/main.do" target="_blank">
                        <i class="icon iconfont icon-qingzhiliandong" style="font-size: 60px;"></i>
                        <span>情指联动</span>
                    </a>
                </div>
                <div class="page-item xs" style="background: #e69426">
                    <a href="javascript:;">
                        <i class="icon iconfont icon-shipinfenxi" style="font-size: 60px;"></i>
                        <span>视频会议</span>
                    </a>
                </div>
                <div class="page-item sm" style="background: #515ab5">
                    <a href="javascript:;">
                        <i class="icon iconfont icon-qingbaozhiling" style="font-size: 55px;"></i>
                        <span>情报指令</span>
                    </a>
                </div>
                <div class="page-item xs" style="background: #365f93">
                    <a href="javascript:;">
                        <i class="icon iconfont icon-zonghechaxun1" style="font-size: 70px;"></i>
                        <span>综合查询</span>
                    </a>
                </div>
            </div>
            <div class="row">
                <div class="col-xs-5" style="width: 41.3%;">
                    <div class="panel">
                        <div class="panel-heading text-center head-high">
                            <%--<i class="icon iconfont icon-iconfontgonggao"></i> --%>
                            通知通报
                            <%--<a href="javascript:ggMore('AN_TZ');" class="pull-right more">--%>
                                <%--更多>>--%>
                            <%--</a>--%>
                        </div>
                        <div class="panel-body" style="height: 396px;">
                            <ul class="advList" id="tztb">
                            </ul>
                        </div>
                    </div>
                </div>
                <div class="col-xs-7" style="padding-left: 0;width: 58.7%;">
                    <div class="panel">
                        <div class="panel-heading text-center head-high">
                            <%--<i class="fa fa-certificate"></i> --%>
                            系统导航
                        </div>
                        <div class="panel-body" style="height: 397px;;width: 100%; overflow-y:auto;">
                            <div class="row">
                                <div class="col-xs-6">
                                    <ul class="advList">
                                        <li><a href="http://wffzry-zyk.zx.ga/" target="_blank">全国违法犯罪人员信息资源库</a></li>
                                        <li><a href="http://jy-zyk.zx.ga/" target="_blank">全国警员基本信息资源库</a></li>
                                        <li><a href="http://ztry.xz.ga/" target="_blank">全国在逃人员信息系统</a></li>
                                        <li><a href="http://bdqqc-zyk.zx.ga/" target="_blank">全国被盗抢汽车信息资源库</a></li>
                                        <li><a href="http://jdcjsr-zyk.zx.ga/first.do" target="_blank">全国机动车/驾驶人信息资源库</a></li>
                                        <li><a href="http://rk-zyk.zx.ga/" target="_blank">全国人口信息库</a></li>
                                        <li><a href="http://zhcx.zx.ga/index1024.jsp" target="_blank">全国公安综合信息查询系统</a></li>
                                        <li><a href="http://jdxt.jd.ga/" target="_blank">毒品犯罪综合信息查询系统</a></li>
                                        <li><a href="https://rk-zyk.zx.ga/login.do?method=begin" target="_blank">公安部部级人口信息管理系统</a></li>
                                        <li><a href="http://10.6.1.37:8001/beeaweb/" target="_blank">公安部出入境管理信息系统</a></li>
                                        <li><a href="http://10.78.22.24:8080/pt/" target="_blank">公共交通信息管理系统</a></li>
                                        <li><a href="http://10.78.5.146/web/" target="_blank">违法犯罪人员信息系统</a></li>
                                        <li><a href="http://10.78.8.103:8090/SYZ_PGIS_bzcj/" target="_blank">食药侦管理系统</a></li>
                                        <li><a href="http://10.79.8.16/xcky/pages/security/login.action/" target="_blank">全国公安机关现场勘验信息系统</a></li>
                                    </ul>
                                </div>
                                <div class="col-xs-6">
                                    <ul class="advList">
                                        <li><a href="http://10.79.8.190:9080/dna/" target="_blank">DNA数据库</a></li>
                                        <li><a href="http://10.78.5.244/" target="_blank">沈阳市警务通管理系统</a></li>
                                        <li><a href="http://www.gaxf.ga" target="_blank">公安信访综合信息系统</a></li>
                                        <li><a href="http://10.78.17.163/login.php" target="_blank">旅游业治安管理信息系统</a></li>
                                        <li><a href="http://10.78.17.164:10001/SSO/login?from=http://10.78.17.153:85/" target="_blank">机动车修理信息系统</a></li>
                                        <li><a href="http://10.78.17.113/login.html" target="_blank">辽宁省公安厅印章信息管理系统（沈阳）</a></li>
                                        <li><a href="http://10.78.17.153:90" target="_blank">辽宁省典当业治安管理信息系统</a></li>
                                        <li><a href="http://10.78.1.216:9081/mbxxglxt/" target="_blank">民用爆炸物品信息管理系统</a></li>
                                        <li><a href="http://zddw-zyk.zx.ga/" target="_blank">全国安全重点单位信息资源库</a></li>
                                        <li><a href="http://10.78.8.92:8080/yhbzglxt/" target="_blank">烟花爆竹信息管理系统</a></li>
                                        <li><a href="http://10.78.23.49:9081/qzmis/" target="_blank">全国枪支管理信息系统</a></li>
                                        <li><a href="http://10.78.17.153" target="_blank">娱乐场所治安管理信息系统</a></li>
                                        <li><a href="https://zxjsbr.za.ga/querylist.do?method=query" target="_blank">全国重性精神病网址登陆</a></li>
                                        <li><a href="http://10.1.6.61:8088/zhxt/loginPKI.jsp" target="_blank">经侦云平台</a></li>

                                    </ul>
                                </div>
                            </div>

                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="panel" id="rightTreeBox" style="width: 254px;">
        <div class="panel-body right-tree">
            <div class="tree-head">
                <div class="tree-header">
                    <img src="${ctx}/static/images/jctx.jpg" alt="">
                </div>
                <span>沈阳市公安局</span>
            </div>
            <div id="treeApp" class="ztree" style="width: 100%;height: 500px; overflow: auto;"></div>
        </div>
        <div class="right-tree-btn">
            <%--<i class="fa fa-angle-right"></i>--%>
        </div>
    </div>
</div>

<div class="modal fade" id="ggModal">
    <div class="modal-dialog" style="width: 950px">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                <h4 class="modal-title" id="ggModalTitle"></h4>
            </div>
            <div class="modal-body">
                <form action="${ctx}/announcement/doSave" name="announcementForm" id="announcementForm" method="post" class="form-horizontal">
                    <input type="hidden" id="announcement_id" name="announcement_id" value="${announcement.announcement_id}">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">标题</label>
                        <div class="col-sm-8">
                            <div class="recordInfo" id="ggtitle"></div>
                        </div>
                    </div>
                    <%--<div class="form-group">
                        <label class="col-sm-2 control-label">类型</label>
                        <div class="col-sm-8">
                            <div class="recordInfo" id="ggtype"></div>
                        </div>
                    </div>--%>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">内容</label>
                        <div class="col-sm-8">
                            <div class="recordInfo" id="ggcontent"></div>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal"><i class="glyphicon glyphicon-off"></i> 关闭</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div>

<div class="modal fade" id="ggMoreModal">
    <input id="ggtype" value="" type="hidden">
    <div class="modal-dialog" style="width: 950px">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                <h4 class="modal-title" id="ggMoreModalTitle"></h4>
            </div>
            <div class="modal-body">

                <form action="" onsubmit="return false;">
                    <div class="row">
                        <div class="col-xs-3">
                            <div class="form-group marBN">
                                <div class="iconic-input">
                                    <i class="fa fa-user"></i>
                                    <input type="text" class="form-control" id="query_ggtitle" name="query_ggtitle" placeholder="按标题查找">
                                </div>
                            </div>
                        </div>
                        <div class="col-xs-3">
                            <button id="gg_searchBtn" type="submit" class="btn btn-success"><i class="glyphicon glyphicon-search"></i> 查找</button>
                            <button type="reset" class="btn btn-warning"><i class="fa fa-trash-o"></i> 清空</button>
                        </div>
                    </div>
                </form>
                <table id="gg_table"
                       data-toggle="table"
                       data-classes="table table-hover"
                       data-sort-order="asc"
                       data-method="get"
                       data-data-type="json"
                       data-pagination="true"
                       data-minimum-count-columns="3"
                       data-page-size="10"
                       data-locale="zh-CN"
                       data-striped="true"
                ></table>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal"><i class="glyphicon glyphicon-off"></i> 关闭</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div>
<script>
    $(function () {
        $.getJSON('${ctx}/judgmenthall/getAnnouncement', {limit: 10,type:'AN_GG'}, function (data) {
            $("#advList").empty();
            $.each(data, function(index, item){
                var html = '<li><a href="javascript:showGgTz(\'AN_GG\',\''+item.announcement_id+'\')">'+ item.title +'</a></li>'
                $("#advList").append(html);
            });
        });

        $.getJSON('${ctx}/judgmenthall/getAnnouncement', {limit: 10,type:'AN_TZ'}, function (data) {
            $("#tztb").empty();
            $.each(data, function(index, item){
                var html = '<li><a href="javascript:showGgTz(\'AN_TZ\',\''+item.announcement_id+'\')">'+ item.title +'</a></li>'
                $("#tztb").append(html);
            });
        });

        $.post("${ctx}/taskUnassign/taskAssignCount",function (data) {
            $('.dqs').text(data.assignCount + '件');
        });
        $.post("${ctx}/taskWait/taskWaitCount",function (data) {
            $('.dsp').text(data.waitCount + '件')
        });
        $.post("${ctx}/judgetask/getJudgeTaskCount ",function (data) {
            $('.dbl').text(data.judgeTaskCount + '件')
        });


        $('.right-tree-btn').click(function () {
            lefttreeHide();
        });
        function lefttreeHide() {
            $("#rightTreeBox").css({
                'width': '0px',
                'overflow': 'hidden'
            });
            $('.homepage').css('paddingRight','20px');
            $('.right-tree-btn2').fadeIn(300);
        };
        $('.right-tree-btn2').click(function () {
            lefttreeShow();
        });
        function lefttreeShow() {
            $("#rightTreeBox").css({
                'width': '280px',
                'overflow': 'visible'
            });
            $('.homepage').css('paddingRight','380px');
            $('.right-tree-btn2').hide();
        };

        //   部门组织树及选择部门代码
        var zTreeObj;
        var zNodes;
        function  filter(treeId, parentNode, data) {
            if (!data) return null;
            var childNodes = [];
            childNodes = data;

            for(var i=0;i<childNodes.length;i++){
                childNodes[i].isParent = true;
            };

            return childNodes;
        };

        $.post('${ctx}/org/getOrgTree',{
            parentId:'',
        },function (data) {
            var setting = {
                view: {
                    showLine: false,
                    expandSpeed:'fast'
                },
                async: {
                    enable: true,
                    contentType: "application/x-www-form-urlencoded",
                    url: "${ctx}/org/getOrgTree",
                    dataType: "text",
                    type:'post',
                    autoParam: ["org_id=parentId"],
                    dataFilter: filter
                },
                check:{
                    enable: false,
                    chkStyle: "radio",
                    radioType: "all"
                }
            };

            zNodes = data;
            zNodes[0].open=true;
            zNodes[0].isParent = true;

            for(var i=0;i<zNodes[0].children.length;i++){
                zNodes[0].children[i].isParent = true;
            };

            zTreeObj = $.fn.zTree.init($("#treeApp"), setting, zNodes);
        });
        //部门组织树及选择部门代码 end
    });

    function ggMore(type){
        $("#ggtype").val(type);
        if(type=='AN_GG'){
            $("#ggMoreModalTitle").html("公告");
        }else{
            $("#ggMoreModalTitle").html("通知通报");
        }
        queryAnnouncement();
        $('#ggMoreModal').modal('show');
    }

    $('#gg_searchBtn').click(function(){
        queryAnnouncement();
    });
    function queryAnnouncement(){
        $("#gg_table").bootstrapTable('refreshOptions',
                {
                    pagination: true,
                    dataShowToggle: true,
                    url: "${ctx}/announcement/getAnnouncementList",
                    queryParams: function (params) {
                        return $.extend({}, params, {
                            query_title: $('#query_ggtitle').val(),
                            query_type: $("#ggtype").val()
                        });
                    }
                });
    }


    $("#gg_table").bootstrapTable({
        contentType: "application/x-www-form-urlencoded",
        method: 'post',
        sidePagination: 'server',
        toolbar: '#toolbar',
        pagination: true,
        dataShowToggle: true,
        // url:"${ctx}/announcement/getAnnouncementList",
        columns: [
            {
                field: 'num',
                title: '序号',
                formatter:function (value, row, index) {
                    if($('.pagination').find('li.active').find('a').text()){
                        var numbers = parseInt([parseInt($('.pagination').find('li.active').find('a').text())-1]* parseInt($('.page-size').text()) )+ parseInt(index+1);
                        return [
                            numbers
                        ].join('') ;
                    }else{
                        return [
                            index+1
                        ].join('') ;
                    }

                }
            }, {
                field: 'title',
                title: '标题'
            },/*{
             field: 'type_value',
             title: '类型'
             },*/{
                field: 'user_name',
                title: '发布人'
            },{
                field: 'cdate',
                title: '发布时间',
                formatter:fmtdate
            },{
                field: 'announcement_id',
                title: '操作',
                formatter:gg_option
            }]
    });
    function gg_option(value,row){
        return [
            '<button class="btn btn-xs btn-info" onclick="showGgTz(\''+row.type+'\',\''+value+'\')"><i class="fa fa-eye"></i> 查看</button>&nbsp;&nbsp;',
        ].join('');
    }
    function fmtdate(value){
        return [
            value.substring(0,10)
        ].join('');
    }

    function showGgTz(type,value){
        $('#ggMoreModal').modal('hide');
        if(type=='AN_GG'){
            $("#ggModalTitle").html("公告");
        }else{
            $("#ggModalTitle").html("通知通报");
        }

        $.getJSON('${ctx}/announcement/getAnnouncementInfo', {announcement_id: value}, function (data) {
            $("#ggtitle").html(data.title);
            //$("#ggtype").html(data.type_value);
            $("#ggcontent").html(data.content);
            $('#ggModal').modal('show');
        });

    }

</script>